package com.cosc716.restaurant.domain;

import java.util.Random;

public class MenuItem {


		private String name;
		private double price;
		private String ingredient;
		private double calories;
		private double rating;
		private boolean heartHealthy;
		private int prepTime;	// used by the simulator
		
	public MenuItem(String name) {
		this.name = name;
	}
		
	public MenuItem(String name,double price, String ingredient, double calories,
					double rating, boolean heartHealthy) {
		
		this.name=name;
	    this.price=price;
        this.ingredient=ingredient;
	    this.calories=calories;
	    this.rating=rating;
		this.setHeartHealthy(heartHealthy);
		
		Random generator = new Random(19580427);
		this.prepTime = generator.nextInt(5) + 1;
	}
	
	
	public String getName()
	{
		return name;
	}
	
	public Double getPrice()
	{
		return price;
	}

	public String getIngredient()
	{
		return ingredient;
	}
	
	public Double getCalories()
	{
		return calories;
	}
	
	public double getRating()
	{
		return rating;
	}
	
	public int getPrepTime() {
		return prepTime;
	}
	
	public String toString()
	{
		String result="Name:"+"\t"+name +"\n" +"Price:\t"+price+"\n"
	                   +"Ingredients:\t"+ingredient+"\n"+"Calories:\t"
				        +calories+"\n"+"Rating\t"+rating+"\n";
		return result;
	}


	public boolean isHeartHealthy() {
		return heartHealthy;
	}


	public void setHeartHealthy(boolean heartHealthy) {
		this.heartHealthy = heartHealthy;
	}
	
	@Override
	public boolean equals(Object anObject) {
		MenuItem other = (MenuItem)anObject;
		
		return name.equalsIgnoreCase(other.name);
	}
}
